# _*_ coding: utf-8 _*_
# @Time : 2020/10/27 14:36
# @Author : liupengfei
# @File : views.py
from rest_framework import generics, permissions
from apps.member.activity.models import Activity
from utils.custom_modelviewset import CustomModelViewSet
from .serialiers import VoteActivityBackSerialzier


class VoteActivityViewSet(CustomModelViewSet):
    permission_classes = [permissions.IsAdminUser]
    queryset = Activity.objects.filter(activity_type=Activity.VOTE)
    serializer_class = VoteActivityBackSerialzier


class BargainActivityViewSet(CustomModelViewSet):
    permission_classes = [permissions.IsAdminUser]
    queryset = Activity.objects.filter(activity_type=Activity.BARGAIN)
    serializer_class = VoteActivityBackSerialzier
